<?php

namespace app\index\controller;

use think\Controller;
use app\index\model\File;
use app\index\model\Oss;

class Image extends Controller
{
    public function index()
    {
        $image = $this->request->file("image");
        $fileName = File::uploadImg($image);
        $oss = new Oss();
        $result = $oss->uploadFile($fileName,time());
        echoJson(1,"上传成功",$result["info"]["url"]);
    }
}